/*
 * Copyright (c) 2010 Google Inc.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

package com.google.api.data.gdata.v2.model;

import com.google.api.client.util.Key;

/**
 * Allows storing person's name in a structured way. Consists of given name,
 * additional name, family name, prefix, suffix and full name.
 * 
 * @since 2.2
 * @author Nicolas Garnier
 */
public class Name {

  /** Person's given name. */
  @Key("gd:givenName")
  public NameWithYomi givenName;

  /** Additional name of the person, eg. middle name. */
  @Key("gd:additionalName")
  public NameWithYomi additionalName;

  /** Person's family name. */
  @Key("gd:famillyName")
  public NameWithYomi famillyName;

  /** Honorific prefix, eg. 'Mr' or 'Mrs'. */
  @Key("gd:namePrefix")
  public String namePrefix;

  /** Honorific suffix, eg. 'san' or 'III'. */
  @Key("gd:nameSuffix")
  public String nameSuffix;

  /** Unstructured representation of the name. */
  @Key("gd:fullName")
  public String fullName;
  
  /**
   * Specifies additional (eg. middle) name of the person, eg. "Susan".
   */
  public static class NameWithYomi {
    /** Phonetical representation. */
    @Key("@gd:yomi")
    public String yomi;

    /** The name value */
    @Key("text()")
    public String value;
  }
}
